<?php
require_once('inc/sync.php');

class Bank {
    
    private static $_instance;

    /**
     * 
     * Create connection database
     * @return Mysql
     * 
     */
    public static function factory() {
        if (!self::$_instance) {
            self::$_instance = new Mysql();
        }
        return self::$_instance;
    }
    
    public static function getId() {
        return self::factory()->getId();
    }
    
    public static function findAll(){
        $query = "SELECT * FROM bank";
        return self::factory()->find($query);
    }
    
    public static function findById($id){
        $query = "SELECT * FROM bank WHERE id={$id}";
        return self::factory()->find($query);
    }
}

?>
